import { S } from '../../s';
import { IPSControlAction } from '../ipscontrol-action';
import { PSMDAjaxControlImpl } from '../psmdajax-control-impl';
import { IPSChart } from './ipschart';
import { IPSChartAngleAxis } from './ipschart-angle-axis';
import { IPSChartCoordinateSystem } from './ipschart-coordinate-system';
import { IPSChartDataSet } from './ipschart-data-set';
import { IPSChartDataSetGroup } from './ipschart-data-set-group';
import { IPSChartGrid } from './ipschart-grid';
import { IPSChartParallel } from './ipschart-parallel';
import { IPSChartParallelAxis } from './ipschart-parallel-axis';
import { IPSChartPolar } from './ipschart-polar';
import { IPSChartRadar } from './ipschart-radar';
import { IPSChartRadiusAxis } from './ipschart-radius-axis';
import { IPSChartSingle } from './ipschart-single';
import { IPSChartSingleAxis } from './ipschart-single-axis';
import { IPSChartXAxis } from './ipschart-xaxis';
import { IPSChartYAxis } from './ipschart-yaxis';
import { IPSLanguageRes } from '../../res/ipslanguage-res';

export class PSChartImpl extends PSMDAjaxControlImpl implements IPSChart {
  get coordinateSystem():
    | 'XY'
    | 'POLAR'
    | 'RADAR'
    | 'PARALLEL'
    | 'SINGLE'
    | 'CALENDAR'
    | 'MAP'
    | 'NONE' {
    return this.M.coordinateSystem;
  }

  get emptyText(): string {
    return this.M.emptyText;
  }

  protected emptytextpslanguageres: IPSLanguageRes;
  getEmptyTextPSLanguageRes(): IPSLanguageRes | null {
    return (
      this.emptytextpslanguageres ||
      (this.emptytextpslanguageres = this.fillObjectModel(
        S._276,
        this.M.getEmptyTextPSLanguageRes,
        S._2b4,
      ) as IPSLanguageRes)
    );
  }

  protected getpscontrolaction: IPSControlAction;
  getGetPSControlAction(): IPSControlAction | null {
    if (this.getpscontrolaction != null) return this.getpscontrolaction;
    const value = this.M.getGetPSControlAction;
    if (value == null) {
      return;
    }
    this.getpscontrolaction =
      this.getPSControlHandler().findPSControlHandlerAction(value);
    return this.getpscontrolaction;
  }

  protected pschartangleaxises: IPSChartAngleAxis[];
  getPSChartAngleAxises(): IPSChartAngleAxis[] | null {
    return (
      this.pschartangleaxises ||
      (this.pschartangleaxises = this.fillChildListModel(
        this.M.getPSChartAngleAxises,
        S._103,
      ) as IPSChartAngleAxis[])
    );
  }

  findPSChartAngleAxis(objKey: any): IPSChartAngleAxis | null {
    return this.getPSModel5(
      S._103,
      this.getPSChartAngleAxises(),
      objKey,
    ) as IPSChartAngleAxis;
  }

  protected pschartcoordinatesystems: IPSChartCoordinateSystem[];
  getPSChartCoordinateSystems(): IPSChartCoordinateSystem[] | null {
    return (
      this.pschartcoordinatesystems ||
      (this.pschartcoordinatesystems = this.fillChildListModel(
        this.M.getPSChartCoordinateSystems,
        S._e4,
      ) as IPSChartCoordinateSystem[])
    );
  }

  findPSChartCoordinateSystem(objKey: any): IPSChartCoordinateSystem | null {
    return this.getPSModel5(
      S._e4,
      this.getPSChartCoordinateSystems(),
      objKey,
    ) as IPSChartCoordinateSystem;
  }

  protected pschartdatasetgroups: IPSChartDataSetGroup[];
  getPSChartDataSetGroups(): IPSChartDataSetGroup[] | null {
    return (
      this.pschartdatasetgroups ||
      (this.pschartdatasetgroups = this.fillChildListModel(
        this.M.getPSChartDataSetGroups,
        S._f0,
      ) as IPSChartDataSetGroup[])
    );
  }

  findPSChartDataSetGroup(objKey: any): IPSChartDataSetGroup | null {
    return this.getPSModel5(
      S._f0,
      this.getPSChartDataSetGroups(),
      objKey,
    ) as IPSChartDataSetGroup;
  }

  protected pschartdatasets: IPSChartDataSet[];
  getPSChartDataSets(): IPSChartDataSet[] | null {
    return (
      this.pschartdatasets ||
      (this.pschartdatasets = this.fillChildListModel(
        this.M.getPSChartDataSets,
        S._f2,
      ) as IPSChartDataSet[])
    );
  }

  findPSChartDataSet(objKey: any): IPSChartDataSet | null {
    return this.getPSModel5(
      S._f2,
      this.getPSChartDataSets(),
      objKey,
    ) as IPSChartDataSet;
  }

  protected pschartgrids: IPSChartGrid[];
  getPSChartGrids(): IPSChartGrid[] | null {
    return (
      this.pschartgrids ||
      (this.pschartgrids = this.fillChildListModel(
        this.M.getPSChartGrids,
        S._f7,
      ) as IPSChartGrid[])
    );
  }

  findPSChartGrid(objKey: any): IPSChartGrid | null {
    return this.getPSModel5(
      S._f7,
      this.getPSChartGrids(),
      objKey,
    ) as IPSChartGrid;
  }

  protected pschartparallelaxises: IPSChartParallelAxis[];
  getPSChartParallelAxises(): IPSChartParallelAxis[] | null {
    return (
      this.pschartparallelaxises ||
      (this.pschartparallelaxises = this.fillChildListModel(
        this.M.getPSChartParallelAxises,
        S._ff,
      ) as IPSChartParallelAxis[])
    );
  }

  findPSChartParallelAxis(objKey: any): IPSChartParallelAxis | null {
    return this.getPSModel5(
      S._ff,
      this.getPSChartParallelAxises(),
      objKey,
    ) as IPSChartParallelAxis;
  }

  protected pschartparallels: IPSChartParallel[];
  getPSChartParallels(): IPSChartParallel[] | null {
    return (
      this.pschartparallels ||
      (this.pschartparallels = this.fillChildListModel(
        this.M.getPSChartParallels,
        S._100,
      ) as IPSChartParallel[])
    );
  }

  findPSChartParallel(objKey: any): IPSChartParallel | null {
    return this.getPSModel5(
      S._100,
      this.getPSChartParallels(),
      objKey,
    ) as IPSChartParallel;
  }

  protected pschartpolars: IPSChartPolar[];
  getPSChartPolars(): IPSChartPolar[] | null {
    return (
      this.pschartpolars ||
      (this.pschartpolars = this.fillChildListModel(
        this.M.getPSChartPolars,
        S._105,
      ) as IPSChartPolar[])
    );
  }

  findPSChartPolar(objKey: any): IPSChartPolar | null {
    return this.getPSModel5(
      S._105,
      this.getPSChartPolars(),
      objKey,
    ) as IPSChartPolar;
  }

  protected pschartradars: IPSChartRadar[];
  getPSChartRadars(): IPSChartRadar[] | null {
    return (
      this.pschartradars ||
      (this.pschartradars = this.fillChildListModel(
        this.M.getPSChartRadars,
        S._109,
      ) as IPSChartRadar[])
    );
  }

  findPSChartRadar(objKey: any): IPSChartRadar | null {
    return this.getPSModel5(
      S._109,
      this.getPSChartRadars(),
      objKey,
    ) as IPSChartRadar;
  }

  protected pschartradiusaxises: IPSChartRadiusAxis[];
  getPSChartRadiusAxises(): IPSChartRadiusAxis[] | null {
    return (
      this.pschartradiusaxises ||
      (this.pschartradiusaxises = this.fillChildListModel(
        this.M.getPSChartRadiusAxises,
        S._108,
      ) as IPSChartRadiusAxis[])
    );
  }

  findPSChartRadiusAxis(objKey: any): IPSChartRadiusAxis | null {
    return this.getPSModel5(
      S._108,
      this.getPSChartRadiusAxises(),
      objKey,
    ) as IPSChartRadiusAxis;
  }

  protected pschartsingleaxises: IPSChartSingleAxis[];
  getPSChartSingleAxises(): IPSChartSingleAxis[] | null {
    return (
      this.pschartsingleaxises ||
      (this.pschartsingleaxises = this.fillChildListModel(
        this.M.getPSChartSingleAxises,
        S._10f,
      ) as IPSChartSingleAxis[])
    );
  }

  findPSChartSingleAxis(objKey: any): IPSChartSingleAxis | null {
    return this.getPSModel5(
      S._10f,
      this.getPSChartSingleAxises(),
      objKey,
    ) as IPSChartSingleAxis;
  }

  protected pschartsingles: IPSChartSingle[];
  getPSChartSingles(): IPSChartSingle[] | null {
    return (
      this.pschartsingles ||
      (this.pschartsingles = this.fillChildListModel(
        this.M.getPSChartSingles,
        S._110,
      ) as IPSChartSingle[])
    );
  }

  findPSChartSingle(objKey: any): IPSChartSingle | null {
    return this.getPSModel5(
      S._110,
      this.getPSChartSingles(),
      objKey,
    ) as IPSChartSingle;
  }

  protected pschartxaxises: IPSChartXAxis[];
  getPSChartXAxises(): IPSChartXAxis[] | null {
    return (
      this.pschartxaxises ||
      (this.pschartxaxises = this.fillChildListModel(
        this.M.getPSChartXAxises,
        S._fa,
      ) as IPSChartXAxis[])
    );
  }

  findPSChartXAxis(objKey: any): IPSChartXAxis | null {
    return this.getPSModel5(
      S._fa,
      this.getPSChartXAxises(),
      objKey,
    ) as IPSChartXAxis;
  }

  protected pschartyaxises: IPSChartYAxis[];
  getPSChartYAxises(): IPSChartYAxis[] | null {
    return (
      this.pschartyaxises ||
      (this.pschartyaxises = this.fillChildListModel(
        this.M.getPSChartYAxises,
        S._fc,
      ) as IPSChartYAxis[])
    );
  }

  findPSChartYAxis(objKey: any): IPSChartYAxis | null {
    return this.getPSModel5(
      S._fc,
      this.getPSChartYAxises(),
      objKey,
    ) as IPSChartYAxis;
  }
  get cls(): string {
    return 'PSChartImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._252) return true;
    return super.instanceof(cls);
  }
}
